Buttons and Check Boxes
  "Button", "Check Box", and "Radio Button" types are set up in the same way as "Static" non-text controls (see previous topic), making similar use of STR#, PICT, ICON, SICN, cicn, PAT , PAT#, CURS, acur, and clut resources.  They differ, however, in the role played by the control's Min, Max, and Value.

Control States
  Check boxes and radio buttons can be in any one of four distinct control "states":
  1. unchecked, unhilited
  2. unchecked, hilited  (when clicked)
  3. checked, hilited  (when clicked)
  4. checked, unhilited
Buttons can only be in states 1 & 2 (never checked).
  For buttons, check boxes, and radio buttons that are not linked to resource lists, the control Min should be set to 0, Max to 1, and Value to 0 (unchecked) or 1 (checked).  When such controls are clicked, BaseCt hilites the control (using inversion, color switching, or dimming), and ViewBV (the view driver) checks or unchecks check boxes and radio buttons after the mouse is released.
  For buttons, check boxes, and radio buttons linked to true resource lists (SICN, PAT#, acur, or clut) set Min = 0, Max = index of resource to display, and Value = 0 (unchecked) or Value = Max (checked) to have hiliting/checking displayed by inversion, color switching, or dimming.
  Alternatively, controls linked to resource lists, or a range of resources, or STR# lists containing a list of resources can use different resources to display each control state.  To do this, set the control's Min to a value corresponding to the unchecked state, and Max to a value corresponding to the checked state (or to a button's hilited state).  If the Min and Max differ by more than 1, and the control is not a button, then intermediate values are also used for the hilite states.
  For example, if a check box control is linked to an SICN small icon list, with Min = 4 and Max = 7, then the icons displayed for each state would be:
  1. SICN #4 = unchecked, unhilited
  2. SICN #5 = unchecked, hilited
  3. SICN #6 = checked, hilited
  4. SICN #7 = checked, unhilited
Alternatively, if Min = 4 and Max = 5, then,
  1. SICN #4 = unchecked, unhilited
  4. SICN #5 = checked, unhilited
and inversion, color switching, or dimming would be used to display hilite states.  This scheme provides a very simple way to create custom button, check box, and radio controls without requiring a single line of code to be written.
  Display Note:  If the resource type linked to a check box or radio button is solid (i.e., completely replaces itself when drawn), then you can reduce "flashing" during checking and hiliting by making the control transparent (i.e., don't check "Solid Body" in Style menu).  The "Shaded...(cicn)" check box controls, for example, are transparent since they are based on cicn resources that replace each other when drawn. The "Standard Mimic (SICN)" check box, however, was given a solid body since SICNs do not completely overwrite one another when the checked or hilite state is changed.

Options
  VarCode options 16, 32, and 64 described in the previous topic also apply to buttons, check boxes, and radio buttons.  Two additional options are supported:
• Bit value 128 can be added to the VarCode of button-type controls to indicate that a click in the button should continuously return messages to the program while the button remains pressed (vs. sending one message when the button is released).  The example "Arrows (SICN)" controls illustrate such buttons and are also used in the "vDemoXY" example program.  (This option assumes that "Return on Hit" is checked in the Control dialog.)
• Bit value 4096 can be added to the VarCode to indicate that "dimming" should be used instead of inversion or switching colors to hilite the control.  See "Hilited Appearance" under "Overview" for a complete discussion of hilite options.

Data Linking
  Check box and radio button controls can be linked to program variables (see "Data Links" in the ViewIt Guide for more info on data linking).  Data links are based on the relationship between the current control Value and the control Min & Max.  If Value = Min, then 0 is returned by GetVal.  If Value = Max, then 1 is returned by GetVal.  Similarly, if 0 is passed to BaseCt by SetVal, then Value is set to Min.  If 1 is passed by SetVal, then Value is set to Max.  What this means is that a program always "sees" check boxes and radio buttons as having "values" of zero or one, and never needs to worry about how the control's Min, Max, and Value are being used.